/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package control;

import entidad.Factura;
import entidad.Sistema;
import java.util.Iterator;

/**
 *
 * @author andres.silvao
 */
public class FacturaCTR {

    public FacturaCTR(){
        
    }

    public int get_max_factura(){
        int _max = -1;
        try{
            Iterator _iterator = Sistema.getFacturas_array().iterator();
            Factura _aux_entity;
            while(_iterator.hasNext()){
                    _aux_entity =  (Factura)(_iterator.next());

                    if (_aux_entity.getId() > _max )
                        _max = _aux_entity.getId();
            }
        }
        catch(Exception _exception){
            return _max;
        }
        return _max;
    }
}
